#region Imported Namespaces



using System.Collections.ObjectModel;



#endregion


namespace WtfManager.HierarchicalData
{
  ///<summary>
  /// Represents and manipulates a collection of <see cref="TreeItem">tree items</see>
  ///</summary>
  public class TreeItemsCollection: ObservableCollection<TreeItem>
  {
    #region Properties/Indexers



    ///<summary>
    /// Gets a <see cref="TreeItem"/> by name.
    ///</summary>
    ///<param name="name">A name of <see cref="TreeItem"/> to get.</param>
    public TreeItem this[string name]
    {
      get
      {
        foreach (TreeItem item in this)
        {
          if (item.Name.Equals(name))
            return item;
        }

        return null;
      }
    }



    #endregion
  }
}